package com.example.demo.service.impl;


import bom.example.common.utils.ListUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.domain.User;
import com.example.demo.service.UserService;
import com.example.demo.mapper.UserMapper;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
*
*/
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService{

    @Override
    public List<User> selectUserPageList(String keyword, Integer page, Integer size) {
        Map<String, Object> map=new HashMap<>();
        page=(page-1)*size;
        map.put("page",page);
        map.put("size",size);
        map.put("keyword",keyword);
        List<User> userList=this.baseMapper.selectUserPage(map);
        return userList;
    }

    @Override
    public List<User> selectUserListByIds(List<String> ids) {
        String[] strings=ListUtils.getStringArrays(ids);
        List<User> users=this.baseMapper.selectUserInIds(strings);
        return users;
    }
}
